home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
demo
/
medit.zip
/
CHANGES.DOC
< prev
next >
Wrap
Text File
|
1994-10-12
|
12KB
|
384 lines
7/15/94
-------
Added ME_INSERTSTRING message
-----------------------------
ME_INSERTSTRING
Inserts a string into the editor at the current position.
Parameters
wParam is ME_OVERSTRIKE_MODE if you want to overstrike the existing
text at the current position in the buffer. Any other value of
wParam will insert the text at the current position in the buffer.
lParam is a far pointer to the text to insert. The text may have
embedded tab characters (\t) or newlines (\n).
Returns
TRUE if the text was inserted, FALSE if not.
Example
SendMessage(hWndEdit, ME_INSERTSTRING, ME_INSERT_MODE,
(LONG) (LPSTR) "This is line 1\nAnd this is line 2\n");
Added WM_PARENTNOTIFY message
-----------------------------
The edit control sends its ancestors the WM_PARENTNOTIFY message.
See the Windows SDK documentation for more information on this
message.
7/21/94
-------
Added SEARCH_SELECTMATCH option to the Searching options.
If this is true, then the matched text is highlighted and selected.
Added some Chicago style messages :
EM_EXGETSEL
wParam is 0
lParam is a far pointer to a CHARRANGE structure
EM_GETSELTEXT
wParam is 0
lParam is a far pointer to a buffer which the text will be placed into
EM_EXSETSEL
wParam is 0
lParam is a far pointer to a CHARRANGE structure
EM_EXLINEFROMCHAR
wParam is 0
lParam is index
EM_SETBKGNDCOLOR
wParam is TRUE to use system color, FALSE for RGB value in lParam
lParam is the RGB value
Returns: the old background color
8/3/94
------
Changes to ME_TOGGLEWORDWRAP
wParam can be
WORDWRAP_OFF - turns wordwrap off
WORDWRAP_ON - turns wordwrap on
WORDWRAP_TOGGLE - toggles wordwrap mode
Added ME_REMOVEBOOKMARK
ME_REMOVEBOOKMARK
Removes one or more bookmarks from the editing buffer.
wParam is the letter of the bookmark. It can be 'a' through 'z'. If
wParam is the special value BOOKMARK_REMOVEALL, then all of the
bookmarks associated with the editing buffer will be removed.
lParam is not used
Returns
TRUE
8/8/94
------
Added WM_SETREDRAW message
WM_SETREDRAW
Sets the refresh state of the buffer.
Parameters
wParam can be zero or non-zero. If it is zero, then buffer refreshes
will be disabled. This means that mulitple editing operations can
be performed without the buffer refreshing the window after each
operation. If wParam is non-zero, then refreshing will be enabled.
lParam is not used.
Returns
Nothing
Giving the Parent a Shot at Messages
------------------------------------
Before the editor control processes the following messages :
WM_MBUTTONDOWN
WM_RBUTTONDOWN
WM_LBUTTONDBLCLK
WM_MBUTTONDBLCLK
WM_RBUTTONDBLCLK
it first sends these messages up to the parent. If the parent processes
these messages, it should return a non-zero value to the editor control.
If it returns 0 to the editor, then the editor will take its default
action for these messages.
Example :
In the parent's window procedure :
case WM_RBUTTONDOWN :
PopupMyMenu(); /* Put up a popup menu */
return TRUE; /* Yes, I processed it */
case WM_MBUTTONDOWN :
case WM_LBUTTONDBLCLK :
case WM_MBUTTONDBLCLK :
case WM_RBUTTONDBLCLK :
return FALSE;
8/25/94
-------
Corrected bug in the EM_LINELENGTH message where the value in wParam
(or lParam) was not compatible with the Windows edit control version.
We now pass the character index of the line into either wParam or
lParam.
Replacement classes for Borland's OWL 2.0 and Inmark's zApp released.
Implementation of owner-drawn lines (added)
-----------------------------------
To test out owner-drawn controls, use the MEWIN demo which comes with the
editor. If you start MEWIN with the -o argument, then it will make the edit
buffer an owner-drawn buffer. (ie : win mewin -o foo.c). When you give the
-o argument to MEWIN, it creates edit buffers with the style ES_OWNERDRAW |
ES_HASSTRINGS. In this sample, MEWIN performs some syntax coloring. It
searches for several reserved words in the C/C++ language and draws these
words in a different color and with a bold-faced font.
When a buffer is owner-drawn, several messages are sent to the parent of
the edit control.
The WM_MEASUREITEM message is sent to the parent window in order to allow
your application to determine the height of a newly inserted line. See the
Windows API documentation on the WM_MEASUREITEM message and the correspond-
ing MEASUREITEMSTRUCT data structure. The only difference is that the con-
stant ODT_EDIT is put into the CtlType field of the MEASUREITEMSTRUCT.
If you process the WM_MEASUREITEM message, then you must do two things.
First, you must put a valid value into the itemHeight field of the
MEASUREITEMSTRUCT structure which is passed. Second, you must return the
value TRUE from the parent's window procedure. If you return FALSE, then
the edit control assigned the default height to the line (the default
height is the height of the edit buffer's font).
When a line is deleted from the edit control, a WM_DELETEITEM message is
sent to the parent window. See the Windows API documentation on the
WM_DELETEITEM message and the corresponding DELETEITEMSTRUCT data struc-
ture. The only difference is that the constant ODT_EDIT is put into the
CtlType field of the DELETEITEMSTRUCT.
The most important message is the WM_DRAWITEM message. Again, please see
the Windows API documentation on this message. There is one important point
here which you must keep in mind. Instead of sending a DRAWITEMSTRUCT
structure, the Magma Edit DLL sends a MEDRAWITEMSTRUCT structure. This new
structure contains some addition fields in it which the DRAWITEMSTRUCT does
not have. In particular, it contains the 'lpText' field, which points to
the actual string which should be drawn. The definition of the
MEDRAWITEMSTRUCT structure is contained in MAGMAED.H.
If your application draws the line, it must return TRUE in response to the
WM_DRAWITEM message. Otherwise, if you return FALSE, then the edit control
draws the line on its own.
To get a feel for how to proces the WM_DRAWITEM message, please see the
file UIOWNDRW.C which comes with the MEWIN sample source code.
There are several other messages which are associated with the Magma Edit
control, and these messages let you query and set the various components of
a line's owner-draw information. These messages are :
ME_GETITEMDATA
Queries the item-data value of a line in the edit buffer. Each
line in an owner-drawn edit buffer can have a 4-byte value associated
with it. This value is passed in the 'itemData' field of the
MEASUREITEMSTRUCT, DELETEITEMSTRUCT, and MEDRAWITEMSTRUCT.
Parameters
wParam is the 0-based line number. If lParam is not 0, then the
value in lParam is used as the line number.
lParam can be the 0-based line number.
Returns
The application-defined 4-byte data value which is associated with a line.
ME_SETITEMDATA
Sets the item-data value of a line in the edit buffer. Each
line in an owner-drawn edit buffer can have a 4-byte value associated
with it. This value is passed in the 'itemData' field of the
MEASUREITEMSTRUCT, DELETEITEMSTRUCT, and MEDRAWITEMSTRUCT.
Parameters
wParam is the 0-based line number.
lParam contains the 4-byte value which is associated with the line.
Returns
TRUE if set, LB_ERR if not set.
ME_GETITEMHEIGHT
Queries the owner-drawn height of a line in the edit buffer.
Parameters
wParam is the 0-based line number. If lParam is not 0, then the
value in lParam is used as the line number.
lParam can be the 0-based line number.
Returns
The height of the line.
ME_SETITEMHEIGHT
Sets the owner-drawn height of a line in the edit buffer.
Parameters
wParam is the 0-based line number.
lParam contains the pixel height of the line.
Returns
TRUE if set, LB_ERR if not set.
9/2/94
------
Added :
ME_QUERYNUMWORDS
Queries the number of words in the editor buffer.
Parameters
wParam and lParam are not used.
Returns
A double-word value which contains the number of words in the
editor buffer.
ME_TRIMTEXT
Manipulates the spaces within a string in a variety of ways.
Parameters
wParam can be a combination of one or more of the following :
TRIM_LEADING_BLANKS
Removes leading spaces from the string.
TRIM_TRAILING_BLANKS
Removes trailing spaces from the string.
TRIM_COMPRESS_BLANKS
Compresses multiple spaces into a single space.
lParam can be a far pointer to a string. If lParam is NULL, then
the text of the current line in the editing buffer is used.
Returns
Nothing.
ME_CENTER
Centers a line of text. The 'Right Margin' value is used for the
right border.
Parameters
wParam and lParam are not used.
Returns
Nothing.
ME_REFORMAT
Reformats a paragraph so that it fits between the left and right
margins.
Parameters
wParam and lParam are not used.
Returns
Nothing.
ME_REFORMATALL
Reformats a the entire document, one paragraph at a time, so that
it fits between the left and right margins.
Parameters
wParam and lParam are not used.
Returns
Nothing.
9/12/94
-------
Revised EM_SETTABSTOPS processing.
If the values in the tab array are positive, they are interpreted as
column values. For example,
static int aiTabs[] = { 30, 55, 68, 74 };
SendMessage(hEdit, EM_SETTABSTOPS, 4, (LPARAM) (LPINT) aiTabs);
will set a tab stop at character columns 30, 55, 68 and 74. This
is consistent with the way which most DOS text editors work.
If the values in the tab array are negative, then the values are
considered to be pixel positions.
9/16/94
-------
"AutoReformat" added to options. Setting this to TRUE will tell the editor
to automatically reformat text which has been cut up by a CUT operation.
9/20/94
-------
Added embedded bitmap processing to MEWIN sample code. This takes advantage
of the ownerdrawn style of the Magma Editor DLL. Start MEWIN with the -o
option. IE :
mewin -o foo
If foo has a line of text which starts in column 1 and has the following
format :
<bitmap bitmapfilename>
Where 'bitmapfilename' is the pathname of a bitmap file, then the
MEWIN ownerdraw code will render the bitmap in the edit control.
(Make sure you have the left and right angle brackets too!)
For example, a line starting like this :
<bitmap mewin.bmp>
will read in the bitmao and draw it in the edit buffer at the proper
line position.
9/26/94
-------
ME_HELPONWORD now takes an optional helpfile name as the lParam.
ie:
SendMessage(hEdit, ME_HELPONWORD, 0, (LPARAM) (LPSTR) "myapp.hlp");
New values in MAGMAED.INI for the default font :
[fonts]
height=<int height> (defaults to 14)
face=<string> (defaults to Courier New)
UseOEMCharSet=<0 or 1> (deafults to 0, DEFAULT_CHARSET)
UseFixedPitch=<0 or 1> (deafults to 1, FIXED_PITCH)
These values are read in when the editor DLL initializes. The values
are used as part of a call to the Windows API function CreateFont()
in order to create the default edit control font.
10/4/94
-------
Added ME_QUERYBOOKMARK message and the corresponding BOOKMARKINFO
structure.
ME_QUERYBOOKMARK
wParam is the letter of the bookmark ('a' through 'z' or 'A' through 'Z').
If wParam is 0, then all booomarks will be retrieved.
lParam is an array of BOOKMARKINFO structures.
Returns
The number of bookmarks placed into the array.
10/12/94
--------
The WM_PASTE message pastes from the clipboard. On the other hand, the
ME_PASTE message paste from the internal Magma Editor pick buffer. The
ME_PASTE message understands column pastes, whereas the WM_PASTE message
does not.